Skip to content

Document browser location controls - #602

Open
tnsardesai wants to merge 12 commits into
mainfrom
hypeship/browser-location-docs
Open

tnsardesai wants to merge 12 commits into
mainfrom
hypeship/browser-location-docs

Conversation

@tnsardesai

@tnsardesai tnsardesai commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Adds browsers/location.mdx: setting, updating, clearing, and reading a browser session's timezone and locale.
  • Links the guide from the Configure page.

Why

  • Users need a precise contract for location overrides, region defaults, and updating one field without changing the other.

How

  • Per-field semantics: omit keeps the value, a string overrides it, and null/None clears it to the region default.
  • Validation and normalization (en-us → en-US, iw-IL → he-IL) and the invalid_browser_location error.
  • The location fields in browser responses, how changes take effect in open and new tabs, precedence of Playwright or Puppeteer emulation, and location vs. geolocation.
  • A pooled browser released with reuse: true keeps its location, like cookies and tabs; reuse: false gives a fresh browser.
  • TypeScript and Python examples for each operation.

Context

  • Documents kernel/kernel#4208. Merge after that API and its SDKs ship.
  • Proxy-derived location (kernel/kernel#4209) is excluded.
  • Docs only; no breaking changes.

Testing & Visuals

  • Mintlify deployment and broken-link checks pass; the preview is linked from the PR checks.
  • git diff --check is clean. mintlify dev was not run locally.
  • Open question: neither this page nor browsers/regions is in docs.json navigation. Is that intended?

Note

Low Risk
Documentation-only changes with no runtime or API behavior in this repo.

Overview
Adds a Browser Location guide that documents how to set, update, clear, and read a session’s timezone and locale (region defaults vs per-field overrides via omit / string / null/None), including validation/normalization, invalid_browser_location, response *_source fields, runtime scope (tabs, Intl, Playwright precedence), and pool reuse behavior—with TypeScript and Python examples.

The Configure intro now links Location under “More browser settings” alongside Regions and related browser options.

Reviewed by Cursor Bugbot for commit 4d9d122. Bugbot is set up for automated code reviews on this repo. Configure here.

@mintlify

mintlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Kernel 🟢 Ready View Preview Oct 19, 2026, 11:40 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 032fb40. Configure here.

Comment thread browsers/location.mdx Outdated

@Sayan- Sayan- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few things, nothing huge

Comment thread browsers/location.mdx Outdated
The setting applies across browser contexts, pages, frames, workers, `Intl`, `navigator.language`, `navigator.languages`, and future `Accept-Language` headers. Updating it doesn't restart Chromium or reload pages.

<Note>
Location controls timezone and language behavior. It doesn't set geolocation coordinates, grant geolocation permission, change the system clock, translate browser UI, or guarantee a bot-detection outcome. KERNEL doesn't derive location from a browser's proxy; to match a proxy's country, set the location explicitly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KERNEL doesn't derive location from a browser's proxy; to match a proxy's country, set the location explicitly.

just flagging - not sure we need to expose this internal language externally

Comment thread browsers/location.mdx Outdated

<CodeGroup>
```typescript TypeScript
const browser = await kernel.browsers.update('01j8m3w6q2d7av9n5k4f1p8c', {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - can't remember if we typically hardcode a session id in our code examples like this

Comment thread browsers/location.mdx Outdated
```
</CodeGroup>

PATCH semantics are field-specific:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

  • weird to say PATCH rather than update
  • these should perhaps just be comments inlined in the code blocks rather than after the fact

Comment thread browsers/location.mdx Outdated
Comment on lines +100 to +115
## Read effective location

Browser responses include the effective values and where each came from:

```json
{
"location": {
"timezone": "America/Los_Angeles",
"locale": "en-US",
"timezone_source": "override",
"locale_source": "metro"
}
}
```

`timezone_source` and `locale_source` are `override` for a value set on the session and `metro` for the default of the browser's region. The fields are independent, so their sources can differ.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems unnecessary to expose basic API values in user docs

Comment thread browsers/location.mdx Outdated
Comment on lines +119 to +125
- New pages, frames, workers, and network contexts start with the current location.
- Existing pages and workers receive the update without a reload.
- Existing `Intl` formatter objects and application-level caches can retain values captured before the update. Create a new formatter when you need the latest default.
- Future requests use the updated language preference. Requests already in flight aren't rewritten.
- Customer CDP emulation remains separate from the session default and can temporarily override what a particular target reports.
- Location overrides last only for the browser session, and profiles don't save them.
- A pooled browser released with `reuse: true` keeps its location for the next acquirer, as it keeps cookies and open tabs. Release with `reuse: false` to get a fresh browser.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use to use plainer, human facing language. don't think these would necessarily make sense to a first time reader

Drop the proxy note and the response source values, show updates against
the created browser's session ID with the update rules as code comments,
and describe how changes take effect in plainer language.

This branch was successfully deployed

1 active deployment
staging — 4d9d122b Deployed Oct 19, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants